package com.shirley.netty.handlerorder;

import com.shirley.netty.handlerorder.inbound.InBoundHandler1;
import com.shirley.netty.handlerorder.inbound.InBoundHandler2;
import com.shirley.netty.handlerorder.inbound.InBoundHandler3;
import com.shirley.netty.handlerorder.inbound.InBoundWritingHandler;
import com.shirley.netty.handlerorder.outbound.OutBoundHandler1;
import com.shirley.netty.handlerorder.outbound.OutBoundHandler2;
import com.shirley.netty.handlerorder.outbound.OutBoundHandler3;
import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;

public class HandlerOrderTcpServerChannel extends ChannelInitializer {
    @Override
    protected void initChannel(Channel ch) throws Exception {
        ch.pipeline()
                .addLast(new OutBoundHandler1())
                .addLast(new OutBoundHandler2())
                .addLast(new OutBoundHandler3())
                .addLast(new InBoundHandler1())
                .addLast(new InBoundHandler2())
                .addLast(new InBoundHandler3())
                .addLast(new InBoundWritingHandler());

    }
}
